'use strict'
const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  publicPath: '/',

  devServer: {
    port: 80,
    open: true,
    disableHostCheck: true,
    // host: 'localhost',
    proxy: {
      '/joyingbox': {
        //  target: "http://beta-op.amoue.com/api/v1", //测试线
        // target: 'http://dev-op.jbox.com/api/v1', // 测试线
        target: 'https://active-op.joyingbox.net/api/v1', // 开发环境
        //  target: "http://172.31.10.191:8080/api/v1",
        // target: "http://172.31.11.229:8080/api/v1",//xm?
        changeOrigin: true,
        disableHostCheck: true,
        ws: true,
        pathRewrite: {
          '^/joyingbox': ''
        }
      },
      '/upload': {
        target: 'http://op.jbox.com',
        // target: "http://172.31.0.27/api/v1",
        changeOrigin: true,
        disableHostCheck: true,
        ws: true,
        pathRewrite: {
          '^/upload': ''
        }
      },
      '/data': {
        target: 'http://platfrom.jbox.com/data/platform',
        // target: "http://172.31.0.43:8080/data/platform/",
        changeOrigin: true,
        disableHostCheck: true,
        ws: true,
        pathRewrite: {
          '^/data': ''
        }
      },

      '/nodeApi': {
        target: 'http://127.0.0.1:8080',
        // target: "http://172.31.0.79:8080",
        changeOrigin: true,
        disableHostCheck: true,
        ws: true,
        pathRewrite: {
          '^/nodeApi': '/nodeApi'
        }
      }
    }
  },
  lintOnSave: false,
  productionSourceMap: false,
  // parallel: require('os').cpus().length > 1,
  // 第三方插件配置
  pluginOptions: {
    // ...
  }
}
